SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO



CREATE PROCEDURE dbo.DnnProduct_GetPermissionsByModuleID
	@ModuleID int
AS
	SELECT  *
		FROM    dbo.DnnProduct_Permission
		WHERE   ModuleDefID = (SELECT ModuleDefID FROM dbo.DnnProduct_Modules WHERE ModuleID = @ModuleID)
		OR 	PermissionCode = 'SYSTEM_MODULE_DEFINITION'
		ORDER BY ViewOrder

GO
